/**
 * 
 */
package testy;

import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cii_lib_graph.GComponentManager;

/**
 * @author pdrabik
 *
 */
public class loader {
	
	private static final Logger log = LoggerFactory.getLogger(loader.class);
	
	private Class<?> name;

	public loader() { 
		try {
			 File clasfile = new File("C:\\");
			 URL url = clasfile.toURI().toURL();
			 URL[] urls = new URL[]{url};
			 urls = new URLClassLoader(urls,ClassLoader.getSystemClassLoader()).getURLs();
			 log.debug(""+urls.length);
//			name = ClassLoader.getSystemClassLoader().loadClass("cii_lib_graph.GComponentManager");
			
			URLClassLoader cl = URLClassLoader.newInstance(urls,ClassLoader.getSystemClassLoader());
			name = cl.loadClass("cii_lib_graph.GComponentManager");
			GComponentManager gc = (GComponentManager)name.newInstance();
			gc.initPanel();
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			log.error("", e);
		}
	}
	
	public static void main(String[] args) {
		loader ld = new loader();
		
	}

	public Class<?> getName() {
		return name;
	}

	public void setName(Class<?> name) {
		this.name = name;
	}
}
